using MicroMsg.Common.Event;
using MicroMsg.Resource.@string;
using MicroMsg.Scene;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class WebMMLogoutPage : BasePage
	{
		private EventWatcher m_LogOutOK;
		private EventWatcher m_LogOutErr;
		internal Grid LayoutRoot;
		internal Image image1;
		private bool _contentLoaded;
		public WebMMLogoutPage()
		{
			this.InitializeComponent();
		}
		protected override void OnPageIn(object[] object_0)
		{
			this.m_LogOutOK = new EventWatcher(this, null, new EventHandlerDelegate(this.onEventLogOutOK));
			this.m_LogOutErr = new EventWatcher(this, null, new EventHandlerDelegate(this.onEventLogOutErr));
			EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_LOGOUT_WEBWX_SUCCESS, this.m_LogOutOK);
			EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_LOGOUT_WEBWX_ERR, this.m_LogOutErr);
		}
		protected override void OnPageOut()
		{
			if (this.m_LogOutOK == null)
			{
				return;
			}
			EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_LOGOUT_WEBWX_SUCCESS, this.m_LogOutOK);
			this.m_LogOutOK = null;
			EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_LOGOUT_WEBWX_ERR, this.m_LogOutErr);
			this.m_LogOutErr = null;
		}
		private void onEventLogOutOK(EventWatcher watcher, BaseEventArgs evtArgs)
		{
		}
		private void onEventLogOutErr(EventWatcher watcher, BaseEventArgs evtArgs)
		{
		}
		private void btnLogOut_Click(object sender, RoutedEventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show("", strings.WebMM_LogoutTitle, true, strings.COM_Confirm, strings.COM_Cancel);
			mMMessageBox.set_FontSize(22.0);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.MsgBoxClearDataHandler);
		}
		public void MsgBoxClearDataHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
			{
				NetSceneLogOutWebWx netSceneLogOutWebWx = new NetSceneLogOutWebWx();
				netSceneLogOutWebWx.doScene(MMLogoutWebWxOpcode.MMWEBWX_BANNER_LOGOUT);
				base.GoBack();
				break;
			}
			case 1:
				break;
			default:
				return;
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/WebMM/WebMMLogoutPage.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.image1 = (Image)base.FindName("image1");
		}
	}
}
